import {createStore,applyMiddleware} from 'redux';
// 导入调试工具
import {composeWithDevTools} from 'redux-devtools-extension';
// 导入reducers
import reducers from './reducers';
// 导入saga
import createSagaMiddleware from 'redux-saga';
// 导入saga异步函数
import rootSaga from './sagas';

// 创建saga中间件
const sagaMiddleware=createSagaMiddleware();
// 创建store对象
const store=createStore(reducers,composeWithDevTools(applyMiddleware(sagaMiddleware)));
// 运行sagaMiddlewrea
sagaMiddleware.run(rootSaga);
// store.dispatch({type:'GET_MESSAGE_ASYNC',data:[]});
export default store;